#!/bin/bash
#

bash_count=0
nologin_count=0

count=$(wc -l /etc/passwd | awk '{print $1}')

#按数字方式一行一行读内容
for i in $(seq $count); do
	sh_name=$(head -n $i /etc/passwd | tail -n 1 | awk -F: '{print $7}')
	if [ $sh_name == "/bin/bash" ]; then
		let bash_count++
	elif [ $sh_name == "/sbin/nologin" ]; then
		let nologin_count++
	fi
done

echo "bash用户数：$bash_count,  nologin用户数： $nologin_count"
